﻿namespace JobButenko.Controllers
{
    using System.Web.Mvc;

    using JobButenko.Models.BusinessLogicLayer;

    public class EmployerController : Controller
    {
        // GET: /Employer/
        private readonly DataManager dataManager;

        public EmployerController(DataManager dataManager)
        {
            this.dataManager = dataManager;
        }

        public ActionResult ViewEmployerInfo(int id)
        {
            ViewData.Model = this.dataManager.Employer.GetEmployerFromId(id);
            return View();
        }

        public JsonResult AddVacancy(int vacancyId)
        {
            return Json(this.dataManager.EmployedJob.AddEmployedJob(vacancyId));
        }

        public void DelVacancy(int vacancyId)
        {
            this.dataManager.EmployedJob.DelEmployedJob(vacancyId);
        }

        public ActionResult GetCandidateAddVacancy()
        {
            ViewData.Model = this.dataManager.EmployedJob.GetCandidateAddVacancy();
            return View();
        }
    }
}
